<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${title}">A股估值与行情日报</title>
  <meta name="viewport" content="width=600">

</head>
<body style="margin: 0; padding: 0;">
<section style="max-width: 100%; margin: 0 auto; background-color: #ffffff; font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; color: #333333; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-radius: 10px; overflow: hidden;">
    <!-- 头部标题 -->
    <section style="text-align: center; background: linear-gradient(135deg, #1a5fb4 0%, #2d7ff9 100%); color: white; padding: 10px;">
        <h2 style="margin: 0; font-size: 18px; font-weight: normal;" th:text="|${sub_title}">大盘午盘分析</h2>
    </section>

    <!-- 指数概览 -->
    <section style="display: flex; flex-wrap: wrap; justify-content: space-around; padding: 5; border-bottom: 1px solid #eeeeee;">
        <section style="flex: 1; min-width: 99%; margin: 5px; padding: 0px; text-align: center; border-radius: 8px;" th:styleappend="${sz_up}?'background-color:#ff461f':'background-color:#00bc12'" >
            <h3 style="margin: 0 0 5px 0; font-size: 24px; font-weight: bold; color: #000000; font-weight: normal;">上证指数</h3>
            <p style="font-size: 18px; font-weight: bold; margin: 5px 0;" th:text="${sz_close}">3,250.18</p>
            <p style="color: #e54d42; margin: 5px 0; font-weight: bold;" th:styleappend="${sz_up}?'color:#000000':'color:#000000'" th:text="${sz_chp}">+0.45%</p>
            <p style="margin: 5px 0; font-size: 14px; color: #000000;" th:text="${sz_desc_1}">指数在20均线上方</p>
            <p style="margin: 5px 0; font-size: 14px; color: #000000;" th:text="${sz_desc_2}">指数在20均线上方</p>
            <p style="margin: 5px 0; font-size: 14px; color: #000000;" th:text="${sz_desc_3}">指数在20均线上方</p>
        </section>

        <section style="flex: 1; min-width: 99%; margin: 5px; padding: 2px; text-align: center; border-radius: 8px; "th:styleappend="${cy_up}?'background-color:#ff461f':'background-color:#00bc12'">
            <h3 style="margin: 0 0 5px 0; font-size: 24px; font-weight: bold; color: #000000; font-weight: normal;">创业指数</h3>
            <p style="font-size: 18px; font-weight: bold; margin: 5px 0;" th:text="${cy_close}">3,250.18</p>
            <p style="margin: 5px 0; font-weight: bold;"  th:styleappend="${cy_up}?'color:#000000':'color:#000000'" th:text="${cy_chp}">+0.45%</p>
            <p th:if="${not #strings.isEmpty(cy_desc)}"  style="margin: 5px 0; font-size: 14px; color: #000000;" th:text="${cy_desc}"></p>
        </section>

        <section style="flex: 1; min-width: 99%; margin: 5px; padding: 2px; text-align: center; border-radius: 8px;" th:styleappend="${kc_up}?'background-color:#ff461f':'background-color:#00bc12'">
            <h3 style="margin: 0 0 5px 0;font-weight: bold;  font-size: 24px; color: #000000; font-weight: normal;">科创指数</h3>
            <p style="font-size: 18px; font-weight: bold; margin: 5px 0;" th:text="${kc_close}">3,250.18</p>
            <p style="margin: 5px 0; font-weight: bold;"  th:styleappend="${kc_up}?'color:#000000':'color:#000000'" th:text="${kc_chp}">+0.45%</p>
            <p th:if="${not #strings.isEmpty(kc_desc)}" style="margin: 5px 0; font-size: 14px; color: #666;" th:text="${kc_desc}"></p>
        </section>

        <section style="flex: 1; min-width: 99%; margin: 5px; padding: 2px; text-align: center; border-radius: 8px; background-color: #EAF6FA;">
            <h3 style="margin: 0 0 5px 0; font-size: 24px; font-weight: bold; color: #000000; font-weight: normal;">大盘涨跌比</h3>
            <p style="font-size: 18px; font-weight: bold; margin: 5px 0;" th:text="|${up_count}:${down_count}|">3,250.18</p>
            <p style="margin: 5px 0; font-weight: bold;color:#e54d42;"  th:text="|上涨：${up_count_ratio}|">+0.45%</p>
        </section>
    </section>

    <!-- 今日提示 -->
    <section style="padding: 20px;" th:if="${not #lists.isEmpty(buyList) or not #lists.isEmpty(sellList)}">
        <h3 style="font-size: 18px; margin: 0 0 5px 0; padding-bottom: 10px; border-bottom: 1px solid #eeeeee; color: #1a5fb4;">今日操作提示(下午2:30后)</h3>

        <section style="flex: 1; min-width: 99%; margin: 10px;" th:if="${not #lists.isEmpty(buyList)}">
            <h4 style="margin: 0 0 10px 0; font-size: 16px; color: #e54d42; font-weight: bold;">买入提示</h4>
            <div th:each="buy : ${buyList}">

                <span style="color: #e54d42; font-weight: bold;font-size: 14px;min-width: 99%; "
                      th:text="${buy.stockName}+'('+${buy.stockCode}+')'">半导体及元件</span>
                    <span style="color: #e54d42; font-weight: bold;font-size: 14px;min-width: 99%; order-bottom: 1px dashed #eeeeee; "
                          th:text="'参考价：'+${#numbers.formatDecimal(buy.buyPrice, 1, 2)}">-12.5</span>

            </div>
        </section>

        <section style="flex: 1; min-width: 99%; margin: 10px;" th:if="${not #lists.isEmpty(sellList)}">
            <h4 style="margin: 0 0 10px 0; font-size: 16px; color: #09bb07; font-weight: bold;">止损提示</h4>
            <div th:each="sell : ${sellList}">

                <span style="color: #09bb07; font-weight: bold;font-size: 14px;min-width: 99%; "
                      th:text="${sell.stockName}+'('+${sell.stockCode}+')'">半导体及元件</span>
                    <span style="color: #09bb07; font-weight: bold;font-size: 14px;min-width: 99%; order-bottom: 1px dashed #eeeeee; "
                          th:text="'止损价：'+${#numbers.formatDecimal(sell.cutPrice, 1, 2)}">-12.5</span>

            </div>
        </section>
    </section>
    <!-- 主力资金流向 -->
    <section style="padding: 20px;">
        <h3 style="font-size: 18px; margin: 0 0 5px 0; padding-bottom: 10px; border-bottom: 1px solid #eeeeee; color: #1a5fb4;">主力资金流向（亿元）</h3>
        <h4 th:if="${not #strings.isEmpty(ai)}"  style="margin: 0 0 10px 0; font-size: 14px; color: #FF34B3; font-weight: bold;">
            <!-- 使用 th:each 遍历每一行 -->
            <div th:each="line : ${aiList}">
                <span th:text="${line}"></span>
            </div>

        </h4>
        <section style="display: flex; flex-wrap: wrap;">
            <!-- 主力流入 -->
            <section style="flex: 1; min-width: 99%; margin: 5px;">
                <h4 style="margin: 0 0 10px 0; font-size: 16px; color: #e54d42; font-weight: bold;">主力流入行业</h4>

                <div th:each="volumeData : ${inVolumeDataList}">
                    <p style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #eeeeee; margin: 0;">
                        <span th:text="${volumeData.name}">半导体及元件</span>
                        <span style="color: #e54d42; font-weight: bold;" th:text="'+' + ${volumeData.volumeFmt}+'亿'">+12.5</span>
                    </p>
                </div>
            </section>

            <!-- 主力流出 -->
            <section style="flex: 1; min-width: 99%; margin: 5px;">
                <h4 style="margin: 0 0 10px 0; font-size: 16px; color: #09bb07; font-weight: bold;">主力流出行业</h4>
                <h4 th:if="${not #strings.isEmpty(out_desc)}"  style="margin: 0 0 10px 0; font-size: 14px; color: #09bb07; font-weight: bold;">电子等部分科技板块遭遇资金净流出，这主要反映了在市场高位震荡时期，资金倾向于获利了结，进行“高低切换”</h4>

                <div th:each="volumeData : ${outVolumeDataList}">
                    <p style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #eeeeee; margin: 0;">
                        <span th:text="${volumeData.name}">半导体及元件</span>
                        <span style="color: #09bb07; font-weight: bold;" th:text="${volumeData.volumeFmt}+'亿'">-12.5</span>
                    </p>
                </div>
            </section>
        </section>
    </section>

    <!-- ETF -->
    <section style="padding: 20px;">
        <h3 style="font-size: 18px; margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 1px solid #eeeeee; color: #1a5fb4;">ETF数据</h3>
        <section style="background: #ffffff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08);">
            <!-- 表头 -->
            <section style="display: flex; background: #6A5ACD; border-bottom: 1px solid #5a4abc; width: 100%;">
                <section style="width: 50%; min-width: 120px;  text-align: left; border-right: 1px solid rgba(255,255,255,0.2); color: white; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">ETF名称</section>
                <section style="width: 25%; min-width: 80px; text-align: right; border-right: 1px solid rgba(255,255,255,0.2); color: white; font-weight: 600;">涨跌幅</section>
                <section style="width: 24%; min-width: 80px;  text-align: right; color: white; font-weight: 600;">RSI</section>

            </section>

            <!-- 数据行 -->
            <section style="display: flex; border-bottom: 1px solid #f0f0f0; width: 100%; background: #fafafa;"th:each="etfData,iter : ${etfList}">
                <section style="width: 50%; min-width: 120px; text-align: left; border-right: 1px solid #f0f0f0; font-weight: 250;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" th:text="${etfData.stockName}+'('+${etfData.stockCode}+')'">ETF名称</section>
                <section style="width: 25%; min-width: 80px;  text-align: right; border-right: 1px solid #f0f0f0; font-weight: 500; color: #2ecc71;" th:styleappend="${etfData.chgP != null and etfData.chgP > 0}?'color:#ff461f':'color:#00bc12'" th:text="${#numbers.formatDecimal(etfData.chgP, 1, 2)} + '%'">涨跌幅</section>
                <section style="width: 24%; min-width: 80px;  text-align: right; " th:text="${#numbers.formatDecimal(etfData.rsi, 1, 2)}">RSI</section>
            </section>
        </section>
    </section>

    <!-- ETF -->
    <section style="padding: 20px;">
        <h3 style="font-size: 18px; margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 1px solid #eeeeee; color: #1a5fb4;">ETF数据网格交易</h3>
        <section style="background: #ffffff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08);">
            <!-- 表头 -->
            <section style="display: flex; background: #6A5ACD; border-bottom: 1px solid #5a4abc; width: 100%;">
                <section style="width: 50%; min-width: 120px; text-align: left; border-right: 1px solid rgba(255,255,255,0.2); color: white; font-weight: 200; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">ETF名称</section>
                <section style="width: 25%; min-width: 80px; text-align: right; border-right: 1px solid rgba(255,255,255,0.2); color: white; font-weight: 600;">网格波动率</section>
                <section style="width: 24%; min-width: 80px; text-align: right; color: white; font-weight: 600;">止损线</section>
            </section>

            <!-- 数据行 -->
            <section style="display: flex; border-bottom: 1px solid #f0f0f0; width: 100%; background: #fafafa;"th:each="etfData,iter : ${etfList}">
                <section style="width: 50%; min-width: 120px;  text-align: left; border-right: 1px solid #f0f0f0; font-weight: 200;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" th:text="${etfData.stockName}+'('+${etfData.stockCode}+')'">ETF名称</section>
                <section style="width: 25%; min-width: 80px; text-align: right; border-right: 1px solid #f0f0f0;" th:text="${#numbers.formatDecimal(etfData.atr60Chp, 1, 2)} + '%'">波动率</section>
                <section style="width: 24%; min-width: 80px;  text-align: right;" th:text="${#numbers.formatDecimal(etfData.cutPrice, 1, 2)}">止损价</section>
            </section>
        </section>
    </section>
</section>
</body>
</html>